<%--
  Created by IntelliJ IDEA.
  User: 练钰华
  Date: 2025/11/5
  Time: 13:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
  <title>员工详情 - 员工信息管理系统</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
</head>
<body>
<%-- 顶部导航栏 --%>
<div class="navbar">
  <div class="container">
    <h1>员工信息管理系统</h1>
    <div class="user-info">
      <span>欢迎您，${loginUser.username}！</span>
      <a href="${pageContext.request.contextPath}/LogoutServlet" class="btn logout-btn">退出登录</a>
    </div>
  </div>
</div>

<%-- 员工详情内容 --%>
<div class="container">
  <div class="detail-container">
    <h2>员工详情</h2>
    <div class="detail-item">
      <label>员工ID：</label>
      <span>${employee.id}</span>
    </div>
    <div class="detail-item">
      <label>姓名：</label>
      <span>${employee.name}</span>
    </div>
    <div class="detail-item">
      <label>部门：</label>
      <span>${employee.department}</span>
    </div>
    <div class="detail-item">
      <label>职位：</label>
      <span>${employee.position}</span>
    </div>
    <div class="detail-item">
      <label>薪资：</label>
      <span>${employee.salary.setScale(2)} 元/月</span>
    </div>
    <div class="detail-item">
      <label>邮箱：</label>
      <span>${employee.email == null ? '无' : employee.email}</span>
    </div>
    <div class="detail-item">
      <label>电话：</label>
      <span>${employee.phone == null ? '无' : employee.phone}</span>
    </div>
    <div class="detail-item">
      <label>入职日期：</label>
      <span>${employee.hire_date}</span>
    </div>
    <div class="detail-item">
      <label>创建时间：</label>
      <span>${employee.created_at}</span>
    </div>
    <div class="detail-item">
      <label>最后更新：</label>
      <span>${employee.updated_at}</span>
    </div>
    <div style="margin-top: 30px; text-align: center;">
      <a href="${pageContext.request.contextPath}/EmployeeServlet?action=editPre&id=${employee.id}" class="btn edit-btn">编辑</a>
      <a href="${pageContext.request.contextPath}/EmployeeServlet?action=list" class="btn">返回列表</a>
    </div>
  </div>
</div>
</body>
</html>
